package com.business.action.record;

import com.business.bean.record.ClockOnRecord;
import com.business.bean.record.DispatchCarRecord;
import net.sf.rose.jdbc.PageBean;
import net.sf.rose.jdbc.dao.BeanDAO;
import net.sf.rose.jdbc.query.BeanSQL;
import net.sf.rose.jdbc.service.Service;
import net.sf.rose.web.util.WebUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by jiangwenfeng on 2019/10/19.
 */
@Controller
@RequestMapping("/record/clock")
public class ClockOnRecordAction {
    /**
     * @description 查询打卡记录
     * @author  jiangwenfeng
     * @date 创建时间：2019/10/19 18:31
     */
    @ResponseBody
    @RequestMapping("/getClockOnRecordList.do")
    public PageBean getClockOnRecordList(HttpServletRequest request, Service service) {
        PageBean page = WebUtils.getPageBean(request);
        Map<String, Object> map = WebUtils.getRequestData(request);
        BeanDAO dao = new BeanDAO(service);
        BeanSQL query = dao.getQuerySQL();
        query.setPage(page);
        query.setEntityClass(ClockOnRecord.class);
        query.setTableName("REC_CLOCK_ON_VIEW");
        query.createSql(map);
        dao.list();
        return page;
    }
}
